package com.jj.service.room;

import com.jj.battle.protocol.GameProto;

import java.util.LinkedList;
import java.util.List;

/**
 * Copyrights: QidianGroup@JJ
 *
 * @author: LuHan
 * @date: 2018/1/15, 16:34
 */
public class BattleRecord {
    private List<GameProto.DT_FRAME_CONTENT> content = new LinkedList<>();

    public int getFrameNum() {
        return content.size();
    }

    public List<GameProto.DT_FRAME_CONTENT> getContent() {
        return content;
    }

    public void setContent(List<GameProto.DT_FRAME_CONTENT> content) {
        this.content = content;
    }

    public void addCommand(Long uid, GameProto.PKG_OPERATION cmd){
        GameProto.DT_FRAME_CONTENT.Builder bld = GameProto.DT_FRAME_CONTENT.newBuilder();
        if(uid != null) {
            bld.setOperation(cmd);
            bld.setPlayerId(uid);
            content.add(bld.build());
        }else{
            content.add(null);
        }
    }
}
